﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DBService;

public partial class Posters : System.Web.UI.Page
{

    List<DBService.Poster> posters;
    protected void Page_Load(object sender, EventArgs e)
    {
        ModelAdapter service = new ModelAdapter();
        posters = service.GetNewPosters().Take(100).ToList();
        BindRep();
    }

    private void BindRep()
    {
        SearchResultPosters.DataSource = posters;
        SearchResultPosters.DataBind();
    }

    protected void SearchResultPoster_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {

    }

    protected void Calendar_SelectionChanged(object sender, EventArgs e)
    {
        ModelAdapter service = new ModelAdapter();
        var Date = calendar.SelectedDate;
        posters = service.GetPostersByDate(Date);
        BindRep();
    }
}